package com.example.finalproject.collection;

import com.example.finalproject.User.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CollectionService {
    @Autowired
    private CollectionRepository collectionRepository;
    //调用接口方法添加汽车id到收藏表
    public void insertCollection(String carId) {
        collectionRepository.insertCollection(carId);
    }
    //调用接口方法查询所有汽车
    public List<Collection> findAllCollection(){
        return collectionRepository.findAllCollection();
    }
    //调用接口方法删除汽车
    public void deleteCarById(String carId){
        collectionRepository.deleteCarById(carId);
    }
}
